Skip to content

Remove Mono.Android trim suppressions#11261

Draft
simonrozsival wants to merge 6 commits intomainfrom
dev/simonrozsival/10794-trimming-aot-warnings
Draft

Remove Mono.Android trim suppressions#11261
simonrozsival wants to merge 6 commits intomainfrom
dev/simonrozsival/10794-trimming-aot-warnings

Conversation

@simonrozsival
Copy link
Copy Markdown
Member

Fixes #10794.

Depends on dotnet/java-interop#1416.

This removes the targeted UnconditionalSuppressMessage attributes from src/Mono.Android, excluding the explicitly out-of-scope TypeManager.cs and ManagedTypeManager.cs suppressions.

Changes are split into logical commits:

  • Enable IsAotCompatible for Mono.Android.csproj so trim/AOT analyzer diagnostics are reported.
  • Update Java.Interop to the dependency PR commit that models peer activation/native registration annotations.
  • Annotate Java conversion and JNI array/object paths instead of suppressing warnings.
  • Replace runtime helper suppressions with DAM/RUC propagation where appropriate.

Validation:

  • ./dotnet-local.sh build src/Mono.Android/Mono.Android.csproj -v:minimal -nr:false
  • No IL trim/AOT diagnostics or RS0016/RS0017 diagnostics remain in the final build log.

simonrozsival and others added 4 commits May 1, 2026 20:27
Enable IsAotCompatible so Mono.Android reports trim and AOT analyzer diagnostics during builds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update the Java.Interop submodule to include trim annotations for peer activation and native registration. This points at dotnet/java-interop#1416.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove trim suppressions from Java conversion and array paths by modeling constructor requirements and avoiding untraceable runtime generic construction.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Surface untraceable runtime reflection with RUC and propagate DAM through native registration and peer activation paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@simonrozsival simonrozsival force-pushed the dev/simonrozsival/10794-trimming-aot-warnings branch from 59303c4 to e783332 Compare May 1, 2026 18:27
simonrozsival and others added 2 commits May 1, 2026 20:47
Update the Java.Interop submodule to include IsAotCompatible in Java.Interop.csproj.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TrimmableTypeMap] Address all trimming and AOT warnings

1 participant